//
//  OYUploader.h
//  ObjectiveYouTube
//
//  Created by Tristan O'Tierney on 1/11/08.
//  Copyright 2008 Tristan O'Tierney. All rights reserved.
//

#import <ObjectiveYouTube/ObjectiveYouTube.h>

@class OYPOSTRequest;
@class OYAuthenticator;
@class OYCategory;

@interface OYUploader : NSObject {
	id _delegate;
	OYPOSTRequest *_uploadRequest;
	OYAuthenticator *_authenticator;
	void *_contextInfo;
}

- (id)initWithDelegate:(id)delegate authenticator:(OYAuthenticator *)auth;

- (void)uploadFile:(NSString *)fileName
		 withTitle:(NSString *)title
	   description:(NSString *)description
		  category:(OYCategory *)category
			  tags:(NSArray *)tags
		   privacy:(OYPrivacyType)privacy
			  date:(NSDate *)date
	   contextInfo:(void *)info;

- (void)cancelUpload;
- (BOOL)isUploading;

- (id)delegate;
- (void)setDelegate:(id)delegate;

- (OYAuthenticator *)authenticator;
- (void)setAuthenticator:(OYAuthenticator *)authenticator;
@end

// informal callback protocol
@interface NSObject (OYUploaderDelegate)
- (void)uploader:(OYUploader *)uploader failedUploadWithError:(NSError *)error contextInfo:(void *)info;
- (void)uploader:(OYUploader *)uploader succededWithResponse:(OYVideoResponse *)response contextInfo:(void *)info;
- (void)uploader:(OYUploader *)uploader progress:(size_t)bytesSent total:(size_t)totalLength contextInfo:(void *)info;
@end